import Request from "@/libs/request";
import axios from 'axios'

/**通过免登码获取钉钉用户信息 */
export const getUserFunListByUserDDId = (data: { userDDId: string }) => {
  console.log(JSON.stringify(data));
  return Request.post(`/pmFun/getUserFunListByUserDDId?userDDId=${ data.userDDId }`)
}

/**上传文件 */
export type UploadFile = {
  dentry: {
    id: string
    name: string
    size: number
    spaceId: string
    extension: string
  }
}

export const ddUploadFile = (data: FormData) => Request.post<UploadFile>('dd/ddUploadFile', data, {
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})


/**获取文件授权 */
export const ddGetAuth = (data: { userDDId: string }) => Request.get<any>('/dd/ddGetAuth', data)
